<template>
	<div>
		<el-tabs v-model="activeName" @tab-click="handleClick">
			<el-tab-pane label="认知指数榜?" name="first">
				<el-table v-loading="loading" :data="rszs" style="width: 100%">
					<el-table-column prop="MovieName" label="影片名称" width="180" />
					<el-table-column prop="ReleaseTime" label="上映日期" />
					<el-table-column prop="RenZhiIndex" label="认知指数" width="180" />
					<el-table-column prop="MovieGenre" label="影片类型" width="180" />
					<el-table-column prop="IrankMoM" label="排名变化" />
				</el-table>
			</el-tab-pane>
			<el-tab-pane v-loading="loading" label="购票指数榜?" name="second">
				<el-table :data="gpzs" style="width: 100%">
					<el-table-column prop="MovieName" label="影片名称" width="180" />
					<el-table-column prop="ReleaseTime" label="上映日期" />
					<el-table-column prop="RenZhiIndex" label="认知指数" width="180" />
					<el-table-column prop="MovieGenre" label="影片类型" width="180" />
					<el-table-column prop="IrankMoM" label="排名变化" />
				</el-table>
			</el-tab-pane>
			<el-tab-pane v-loading="loading" label="口碑指数榜?" name="third">
				<el-table :data="kbzs" style="width: 100%">
					<el-table-column prop="MovieName" label="影片名称" width="180" />
					<el-table-column prop="ReleaseTime" label="上映日期" />
					<el-table-column prop="RenZhiIndex" label="认知指数" width="180" />
					<el-table-column prop="MovieGenre" label="影片类型" width="180" />
					<el-table-column prop="IrankMoM" label="排名变化" />
				</el-table>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
	import {
		GetRszs
	} from "@/api/rszs.js"
	import {
		GetGpzs
	} from "@/api/gpzs.js"
	import {
		GetKbzs
	} from "@/api/kbzs.js"
	// import $router from '@/router/index.js'
	export default {
		data() {
			return {
				activeName: 'second',
				rszs: [],
				gpzs: [],
				kbzs: [],
				loading: true,
			}
		},
		methods: {
			handleClick(tab, event) {
				console.log(tab, event);
			}
		},
		watch: {
			$route(to) {
				// if(to.name=='rszs'){
				// 	this.activeName='first'
				// }
				console.log(to.name)
			}
		},
		created() {
			GetGpzs({
				r: 0.004776866386850598,
				indextype: 2,
				datatype: 1,
				sdate: '2022-08-15',
				edate: '2022-08-15',
				pageindex: 1,
				pagesize: 20,
				order: 'BuyTicketIndex',
				ordertype: 'desc',
			}).then(res => {
				console.log(res.data.data[0]);
				this.gpzs = res.data.data[0];
				this.loading = false
			})
			GetRszs({
				r: 0.9865448693395171,
				indextype: 1,
				datatype: 1,
				sdate: '2022-08-15',
				edate: '2022-08-15',
				pageindex: 1,
				pagesize: 20,
				order: 'RenZhiIndex',
				ordertype: 'desc',
			}).then(res => {
				console.log(res.data.data[0]);
				this.rszs = res.data.data[0];
				this.loading = false
			})
			GetKbzs({
				r: 0.8654082295537309,
				indextype: 3,
				datatype: 2,
				sdate: '2022-08-15',
				edate: '2022-08-15',
				pageindex: 1,
				pagesize: 20,
				order: 'RapIndex',
				ordertype: 'desc',
			}).then(res => {
				console.log(res.data.data[0]);
				this.kbzs = res.data.data[0];
				this.loading = false
			})
		}
	}
</script>

<style>
	body {
		margin: 0;
	}
</style>
